//-------------------------------------------------------------------
//	Copyright (c) 2010-2014  Zhirnov Andrey
//	This file is part of the "UX Standard Lib" project.
//	See copyright notice in "UX_STL_Core.h".
//-------------------------------------------------------------------

#ifdef __UX_STL_UNIT_TEST__

//#define PLATFORM_SDL
#include "../ux_stl_core.h"

using namespace UX_STL;
using namespace UXTypes;


void Test_CompileTime_TypeInfo ()
{
	// IsSameTypes //
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< int, int >::value );
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< int *, int * >::value );
	STATIC_ASSERTE( not TypeDescriptor::IsSameTypes< const int, int >::value );
	STATIC_ASSERTE( not TypeDescriptor::IsSameTypes< int *, const int * >::value );
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< int const *, const int * >::value );


	// _MainTypeCheck //
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int8, int64 >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int16, int64 >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int32, int64 >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int8, int16 >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int16, int32 >::value) );

	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< int64, int64 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< int64, int8 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< int64, int16 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< int64, int32 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< int32, int16 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< int16, int8 >::value) );
	
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< float, int8 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< float, int16 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< float, int32 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< float, int64 >::value) );

	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< float, double >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int8, float >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int16, float >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int32, float >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int64, float >::value) );

	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< double, int8 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< double, int8 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< double, int8 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< double, int64 >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< double, float >::value) );
	STATIC_ASSERTE( (TypeDescriptor::_MainTypeCheck< double, double >::value) );
	
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int8, double >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int8, double >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int8, double >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< int64, double >::value) );
	STATIC_ASSERTE( (not TypeDescriptor::_MainTypeCheck< float, double >::value) );
}

#endif	// __UX_STL_UNIT_TEST__